<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=0">

		<title>订单管理</title>

		
		<link href="/static/AmazeUI-2.7.2/AmazeUI-2.7.2/assets/css/padmin.css" rel="stylesheet" type="text/css">
		<link href="/static/AmazeUI-2.7.2/AmazeUI-2.7.2/assets/css/pamazeui.css" rel="stylesheet" type="text/css" />
		<link href="/static/frontend/css/personal.css" rel="stylesheet" type="text/css">
		<link href="/static/frontend/css/orstyle.css" rel="stylesheet" type="text/css">

		<script src="/static/AmazeUI-2.7.2/AmazeUI-2.7.2/assets/js/jquery-3.3.1.min.js"></script>
		<script src="/static/AmazeUI-2.7.2/AmazeUI-2.7.2/assets/js/amazeui.js"></script>
		
	</head>

	<body>
		<!--头 -->
		{include file="../application/frontend/view/common/ptop.html"}
			<b class="line"></b>
		<div class="center">
			<div class="col-main">
				<div class="main-wrap">

					<div class="user-order">

						<!--标题 -->
						<div class="am-cf am-padding">
							<div class="am-fl am-cf"><strong class="am-text-danger am-text-lg">订单管理</strong> / <small>Order</small></div>
						</div>
						<hr/>

						<div class="am-tabs am-tabs-d2 am-margin" data-am-tabs>

							<ul class="am-avg-sm-5 am-tabs-nav am-nav am-nav-tabs">
								<li class="am-active"><a href="#tab1">所有订单</a></li>
								<li><a href="#tab2">待付款</a></li>
								<li><a href="#tab3">退换货</a></li>
								
								
							</ul>

							<div class="am-tabs-bd">
								<div class="am-tab-panel am-fade am-in am-active" id="tab1">
									<div class="order-top">
										<div class="th th-item">
											<td class="td-inner">商品</td>
										</div>
										<div class="th th-price">
											<td class="td-inner">单价</td>
										</div>
										<div class="th th-number">
											<td class="td-inner">数量</td>
										</div>
										<div class="th th-operation">
											<td class="td-inner">商品操作</td>
										</div>
										<div class="th th-amount">
											<td class="td-inner">合计</td>
										</div>
										<div class="th th-status">
											<td class="td-inner">交易状态</td>
										</div>
										<div class="th th-change">
											<td class="td-inner">交易操作</td>
										</div>
									</div>
							
									<div class="order-main">
										<div class="order-list">
											
											
											{foreach name="allbox" item="val" key="i"}
											
											<div class="order-status5">
												<div class="order-title">
													<div class="dd-num">订单编号：{$all[$i]}<a href="javascript:;"></a></div>
													<span>{$orderDate[$i]|date="Y-m-d H:i",###}</span>
													<em>店铺：常泷度假区</em>
												</div>
												{volist name="$val" id="vo" empty="暂时没有数据" }
												<div class="order-content">
													<div class="order-left">
														<ul class="item-list">
															<li class="td td-item">
																<div class="item-pic">
																	<a href="#" class="J_MakePoint">
																		<img src="/static/frontend/img/scenic_img.png" class="itempic J_ItemImg">
																	</a>
																</div>
																<div class="item-info">
																	<div class="item-basic-info">
																		<a href="#">
																			<p>{$vo.product_name}</p>
																			<p class="info-little">{$vo.start_time}
																				<br/>{$vo.end_time} </p>
																		</a>
																	</div>
																</div>
															</li>
															<li class="td td-price">
																<div class="item-price">
																	{$vo.product_price}
																</div>
															</li>
															<li class="td td-number">
																<div class="item-number">
																	<span>{$vo.product_amount}</span>
																</div>
															</li>
															<li class="td td-operation">
																<div class="item-operation">
																	
																</div>
															</li>
														</ul>
							
														
							
													</div>
													<div class="order-right">
														<li class="td td-amount">
															<div class="item-amount">
																合计：{$vo.product_subtotal}
																
															</div>
														</li>
														<div class="move-right">
															<li class="td td-status">
																<div class="item-status">
																	<p class="Mystatus">{$vo.status}</p>
																	
																	
																</div>
															</li>
															<li class="td td-change">
																<div class="am-btn am-btn-danger anniu">
																	<a style="color: white;" href="/frontend/porder/delete?order_id={$vo.order_id}">删除订单</a></div>
															</li>
														</div>
													</div>
												</div>
												{/volist}
											</div>
											
											{/foreach}
											
											
											
							
										</div>
							
									</div>
							
								</div>
								<div class="am-tab-panel am-fade" id="tab2">
							
									<div class="order-top">
										<div class="th th-item">
											<td class="td-inner">商品</td>
										</div>
										<div class="th th-price">
											<td class="td-inner">单价</td>
										</div>
										<div class="th th-number">
											<td class="td-inner">数量</td>
										</div>
										<div class="th th-operation">
											<td class="td-inner">商品操作</td>
										</div>
										<div class="th th-amount">
											<td class="td-inner">合计</td>
										</div>
										<div class="th th-status">
											<td class="td-inner">交易状态</td>
										</div>
										<div class="th th-change">
											<td class="td-inner">交易操作</td>
										</div>
									</div>
							
									<div class="order-main">
										<div class="order-list">
											{foreach name="allbox1" item="val1" key="i"}
											<div class="order-status1">
												<div class="order-title">
													<div class="dd-num">订单编号：<a href="javascript:;" >{$all1[$i]}</a></div>
													<span>{$orderDate[$i]|date="Y-m-d H:i",###}</span>
													<em>店铺：常泷度假区</em>
												</div>
												{volist name="$val1" id="vo" empty="暂时没有数据" }
												<div class="order-content">
													<div class="order-left">
														<ul class="item-list">
															<li class="td td-item">
																<div class="item-pic">
																	<a href="#" class="J_MakePoint">
																		<img src="/static/frontend/img/scenic_img.png" class="itempic J_ItemImg">
																	</a>
																</div>
																<div class="item-info">
																	<div class="item-basic-info">
																		<a href="#">
																			<p>{$vo.product_name}</p>
																			<p class="info-little">{$vo.start_time}
																				<br/>{$vo.end_time} </p>
																		</a>
																	</div>
																</div>
															</li>
															<li class="td td-price">
																<div class="item-price">
																	{$vo.product_price}
																</div>
															</li>
															<li class="td td-number">
																<div class="item-number">
																	{$vo.product_amount}
																</div>
															</li>
															<li class="td td-operation">
																<div class="item-operation">
							
																</div>
															</li>
														</ul>
							
													</div>
													<div class="order-right">
														<li class="td td-amount">
															<div class="item-amount">
																合计：{$vo.product_subtotal}
																
															</div>
														</li>
														<div class="move-right">
															<li class="td td-status">
																<div class="item-status">
																	<p class="Mystatus">等待买家付款</p>
																	<p class="order-info"><a href="/frontend/porder/cancle?order_id={$vo.order_id}">取消订单</a></p>
							
																</div>
															</li>
															<li class="td td-change">
																<a href="/test/clipay/pagepay?WIDout_trade_no={$vo.order_number}&WIDsubject={$vo.product_name}&WIDtotal_amount={$vo.order_total}">
																<div class="am-btn am-btn-danger anniu">
																	一键支付</div></a>
															</li>
														</div>
													</div>
							
												</div>
												{/volist}
											</div>
											{/foreach}
										</div>
							
									</div>
								</div>
								<div class="am-tab-panel am-fade" id="tab3">
									<div class="order-top">
										<div class="th th-item">
											<td class="td-inner">商品</td>
										</div>
										<div class="th th-price">
											<td class="td-inner">单价</td>
										</div>
										<div class="th th-number">
											<td class="td-inner">数量</td>
										</div>
										<div class="th th-operation">
											<td class="td-inner">商品操作</td>
										</div>
										<div class="th th-amount">
											<td class="td-inner">合计</td>
										</div>
										<div class="th th-status">
											<td class="td-inner">交易状态</td>
										</div>
										<div class="th th-change">
											<td class="td-inner">交易操作</td>
										</div>
									</div>
							
									<div class="order-main">
										<div class="order-list">
											{foreach name="allbox2" item="val2" key="i"}
											<div class="order-status2">
												<div class="order-title">
													<div class="dd-num">订单编号：<a href="javascript:;">{$all2[$i]}</a></div>
													<span>{$orderDate[$i]|date="Y-m-d H:i",###}</span>
													<em>店铺：常泷度假区</em>
												</div>
												{volist name="$val2" id="vo" empty="暂时没有数据" }
												<div class="order-content">
													<div class="order-left">
														<ul class="item-list">
															<li class="td td-item">
																<div class="item-pic">
																	<a href="#" class="J_MakePoint">
																		<img src="/static/frontend/img/scenic_img.png" class="itempic J_ItemImg">
																	</a>
																</div>
																<div class="item-info">
																	<div class="item-basic-info">
																		<a href="#">
																			<p>{$vo.product_name}</p>
																			<p class="info-little">{$vo.start_time}
																				<br/>{$vo.end_time} </p>
																		</a>
																	</div>
																</div>
															</li>
															<li class="td td-price">
																<div class="item-price">
																	{$vo.product_price}
																</div>
															</li>
															<li class="td td-number">
																<div class="item-number">
																	{$vo.product_amount}
																</div>
															</li>
															<li class="td td-operation">
																<div class="item-operation">
																	退款
																</div>
															</li>
														</ul>
							
												
													</div>
													<div class="order-right">
														<li class="td td-amount">
															<div class="item-amount">
																合计：{$vo.product_subtotal}
																
															</div>
														</li>
														<div class="move-right">
															<li class="td td-status">
																<div class="item-status">
																	<p class="Mystatus">买家已付款</p>
																	
																</div>
															</li>
															<li class="td td-change">
																<!-- <input type="submit" class="refund" id="refund" value="{$vo.shopcart_id}"> -->
																<div class="am-btn am-btn-danger anniu" id="r_efund" 
																onclick="insert({$vo.shopcart_id},{$vo.order_number},{$vo.product_subtotal},{$vo.status})">
																{$vo.product_refund}
																	</div>
																	
															</li>
														</div>
													</div>
												</div>
												{/volist}
											</div>
											{/foreach}
										</div>
									</div>
								</div>
								
							
								
							</div>

						</div>
					</div>
				</div>
				<!--底部-->
				{include file="../application/frontend/view/common/pbottom.html" }
			</div>
			{include file="../application/frontend/view/common/pmenu.html" }
		</div>
<script type="text/javascript" src="/static/frontend/js/jquery.js"></script>
<script type="text/javascript">
function insert(obj,oba,obb,obc)
{
	var order_number=oba;
	var product_subtotal=obb;
	console.log(order_number);
	console.log(product_subtotal);
	console.log(obc);
	
	if(obc!=0){
		alert('不可操作');
		//$('#r_efund').attr("disabled", "true");
	}
	else
	{
		var conf = '确定退款此商品吗？';
		if(confirm(conf)==true)
		{
			
		 $.ajax({
	        type:"post",
	        url:"/frontend/porder/refund",
	        data:{shopcart_id:obj,order_number:order_number,product_subtotal:product_subtotal},
	        dataType:"json",
	        success:function(ret){
	        
	           alert("已退款");
	         
	            }

	       });
	    }
    }

	 


   
}

</script>
	</body>


</html>
